﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class engage_interviewToController : Controller
    {
        private readonly Iengage_interview he;

        public engage_interviewToController(Iengage_interview he)
        {
            this.he = he;
        }

        public IActionResult engage_interviewTo()
        {
            return View();
        }
        public IActionResult engage_interviewToUpdate(int? id)
        {
            ViewBag.ein_id = id;
            return View();
        }
        //面试登记表查询
        public async Task<IActionResult> QueryTo(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.QueryTo(currentPage, pageSize)));
        }
        //面试查询
        public async Task<IActionResult> QueryTh(int id)
        {
           return Content(JsonConvert.SerializeObject(await he.QueryTh(id)));
        }
        //面试状态修改
        public async Task<int> UpdateTo(engage_interview _Interview, string checker1, string check_time1)
        {
            return await he.UpdateTo(_Interview, checker1, check_time1);
        }
        //面试登记删除
        public async Task<int> Delt(int id)
        {
            return await he.Delt(id);
        }
        //简历登记删除
        public async Task<int> DeltTo(int id)
        {
            return await he.DeltTo(id);
        }
        //面试登记未通修改
        public async Task<int> Updateset(engage_interview _Interview)
        {
            return await he.Updateset(_Interview);
        }
    }
}
